<template>
  <el-config-provider :locale="locale">
    <router-view />
  </el-config-provider>
</template>
<script setup>
import { RouterView } from 'vue-router'
import { useLanguageStore } from '@/stores/language.js'
import { storeToRefs } from 'pinia'
import { ref, computed } from 'vue'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import en from 'element-plus/dist/locale/en.min.mjs'
const { language } = storeToRefs(useLanguageStore())
const localeMap = ref({
  en: en,
  zh: zhCn
})
const locale = computed(() => localeMap.value[language.value])
</script>
